Page<{
  SDKVersion?: string,
  useComponent? :boolean,
  useComponent2? :boolean,
  basicVisible?: boolean,


  // dialog related functions
  showModifyDialog?:boolean,
  labelValue: string,
}, {
  onClickBack(): void,
  handlePopupClose(): void,
  handleTap(): void,




  // dialog related functions
  handleTapDialog(): void,
  onChangeValue(value:string, event: Event): void;
  onButtonConfirmModifyDialog(): void,
  onButtonCancelModifyDialog(): void,
  closeModifyDialog(): void,

}>({
  data: {
    SDKVersion: '',
    basicVisible: false,
    showModifyDialog: false,
    labelValue: '',
  },
  onLoad(query) {
    // 页面加载
    console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
  },
  onReady() {
    // 页面加载完成
  },
  onShow() {
    // 页面显示
    this.setData({
      SDKVersion: my.SDKVersion,
    })
  },
  onUnload() {
    // 页面被关闭
  },
  onTitleClick() {
    // 标题被点击
  },
  onPullDownRefresh() {
    // 页面被下拉
  },
  onReachBottom() {
    // 页面被拉到底部
  },
  onShareAppMessage() {
    // 返回自定义分享信息
    return {
      title: 'My App',
      desc: 'My App description',
      path: 'pages/index/index',
    };
  },
  onClickBack() {
    my.showToast({ content:'点击了返回icon', duration: 1000 });
  },
  handlePopupClose() {
    this.setData({
        basicVisible: false,
    });
  },
  handleTap() {  
    this.setData({
        basicVisible: true,
    });
  },


  

  /// dialog functions  *********************
  handleTapDialog() {  
    //TODO: get description from 
    const labelValue = 'from descript of TotpInfos'
    this.setData({
        showModifyDialog: true,
        labelValue: labelValue,
    });
  },
  onChangeValue(value:string, event: Event) {
    this.setData({
        labelValue: value,
    });

  },
  onButtonConfirmModifyDialog() {
    console.log("onButtonConfirmModifyDialog, input:", this.data.labelValue);
    //save something to TotpInfos
    this.closeModifyDialog();
  },

  onButtonCancelModifyDialog() {
    this.closeModifyDialog();
  },
  closeModifyDialog(){
    this.setData({
        showModifyDialog: false,
    });
  }



});
